package com.neihe.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.neihe.entity.User;
import com.neihe.entity.dto.admin.UpUserStatusDTO;
import com.neihe.entity.dto.admin.UserQueryPageDTO;
import com.neihe.entity.dto.user.CheckCodeDTO;
import com.neihe.entity.dto.user.LoginFormDTO;
import com.neihe.entity.dto.user.RegisterFormDTO;
import com.neihe.entity.dto.user.ResetPwdFormDTO;
import com.neihe.entity.vo.admin.UserQueryPageVO;
import com.neihe.entity.vo.user.UseSpaceVO;
import com.neihe.entity.vo.user.UserInfoVO;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author neihe
 * @since 2025-01-04
 */
public interface IUserService extends IService<User> {

    void sendCode(String email, HttpServletRequest request);

    void checkCode(CheckCodeDTO requestParam);

    void register(RegisterFormDTO requestParam);

    UserInfoVO login(LoginFormDTO requestParam);

    /**
     * 扣减用户空间容量
     *
     * @param userId   用户ID
     * @param fileSize 文件大小
     */
    void deductSpace(Long userId, Long fileSize);

    /**
     * 释放用户空间容量
     *
     * @param userId   用户ID
     * @param fileSize 文件大小
     */
    void addSpace(Long userId, Long fileSize);

    UseSpaceVO getUseSpace(Long userId);

    void resetPassword(ResetPwdFormDTO requestParam);

    IPage<UserQueryPageVO> getUserList(UserQueryPageDTO requestParam);

    void upUserStatus(UpUserStatusDTO requestParam);
}
